<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        window.onload=function()
        {
            //ES6引入rest参数，用于获取函数的实参，用来代替arguments
            //ES5获取实参的方式
            function date1()
            {
                console.log(arguments);
            }
            date1("一号","二号","三号");

            //rest参数
            function date2(...a)
            {
                console.log(a);
            }
            date2("一号","二号","三号");

            //rest参数必须要放到参数最后
            function fun(a,b,...last)
            {
                console.log(a);
                console.log(b);
                console.log(last);
            }
            fun(1,2,3,4,8,84,84,64,8,48,4,34,64,5);
        };
    </script>
</head>
<body>
    
</body>
</html>